package com.example.springmacexercise;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller//让spring框架启动时进行加载
@ResponseBody//返回非页面数据
//@RequestMapping("/user")//路由器规则注册
public class UserController1 {
//    @RequestMapping("/hi")//路由器规则注册
//    public String sayHi(){
//        String s = "hi";
//        return s;
//    }

    @RequestMapping(value = "/hi",method = RequestMethod.POST)
    public String sayHi(){
        return "<h1>hi </h1>";
    }
}
